package com.qk.mapper;

import com.qk.entity.Dept;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * ClassName: DeptMapper
 * Package: com.qk.mapper
 * Description:
 *
 * @Author zt
 * @Create 2025/7/27 9:09
 * @Version 1.0
 */
@Mapper
public interface DeptMapper {
    @Select("insert into dept(name,status,create_time,update_time) values(#{name},#{status},#{createTime},#{updateTime})")
    void add(Dept dept);

    List<Dept> selectByCondition(String name, Integer status);

    @Select("select id, name, status, create_time, update_time from dept where id = #{id}")
    Dept selectById(Integer id);

    void update(Dept dept);

    @Delete("delete from dept where id = #{id}")
    void delete(Integer id);

    @Select("select id, name, status, create_time, update_time from dept")
    List<Dept> list();
}
